# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=regrippy
pkgver=2.0.0
pkgrel=6
pkgdesc='Framework for reading and extracting useful forensics data from Windows registry hives.'
groups=('blackarch' 'blackarch-forensic')
arch=('any')
url='https://pypi.org/project/regrippy/#files'
license=('Apache')
depends=('python' 'python-python-registry' 'python-wheel')
makedepends=('python-setuptools')
source=("https://files.pythonhosted.org/packages/5e/93/3d604be8130408a9b839f8b506732fb2db4b0f4acf6f66082574e2409364/regrippy-2.0.0.tar.gz")
sha512sums=('b7463eb5bbcdc910ee71b326bd785d8588a63e36de4f9269b756b4638f80efe90c46748a3a6ed45e0edc582f311bcf6604ddd6107e4f8490aa868f3889ccb4cd')

build() {
  cd "$pkgname-$pkgver"

  python setup.py build
}

package() {
  cd "$pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  mv "$pkgdir/usr/bin/regrip.py" "$pkgdir/usr/bin/regrip"

  for i in "$pkgdir/usr/bin/"*; do
    if [ "$(echo $i| awk -F/ '{print $NF}')" != "regrip" ]; then
      mv $i "$(echo ${i//_/-})"
    fi
  done
}

